import request from '@/utils/request'

// 查询维修项目列表
export function listProject(query) {
  return request({
    url: '/repair/project/list',
    method: 'get',
    params: query
  })
}

// 查询维修项目详细
export function getProject(id) {
  return request({
    url: '/repair/project/' + id,
    method: 'get'
  })
}

// 新增维修项目
export function addProject(data) {
  return request({
    url: '/repair/project',
    method: 'post',
    data: data
  })
}

// 修改维修项目
export function updateProject(formExecute) {
  console.log(formExecute)
  return request({
    url: '/repair/project/updateProject',
    method: 'post',
    data:formExecute
  })
}

// 执行维修项目
export function executeProject(id,executeDate) {
  return request({
    url: '/repair/project/executeProject/' + id+'/'+executeDate,
    method: 'get'
  })
}

// 撤销维修项目
export function revokeProject(id) {
  return request({
    url: '/repair/project/revokeProject/' + id,
    method: 'get'
  })
}

// 删除维修项目
export function delProject(id) {
  return request({
    url: '/repair/project/' + id,
    method: 'delete'
  })
}

// 获取小区信息
export function getAreaInfo() {
  return request({
    url: '/house/area/list1',
    method: 'get'
  })
}

// 获取楼宇信息
export function getGroupInfo(areaName) {
  return request({
    url: '/house/group/getGroupInfo/' + areaName,
    method: 'get'
  })
}

// 获取单元信息
export function getUnitInfo(areaName, groupName) {
  return request({
    url: '/house/unit/getUnitInfo/' + areaName + "/" + groupName,
    method: 'get'
  })
}

// 获取施工企业
export function getCompanyId() {
  return request({
    url: '/other/company/list',
    method: 'get'
  })
}
// 获取施工企业
export function getCompanyId1(companyName) {
  return request({
    url: '/other/company/list1/'+companyName,
    method: 'get'
  })
}

// 获取小区信息
export function getAreaInfo1(areaName) {
  return request({
    url: '/house/area/list2/'+areaName,
    method: 'get'
  })
}

// 获取维修内容
export function getProjectInfoId() {
  return request({
    url: '/repair/projectInfo/list',
    method: 'get'
  })
}


